package d01016;

public class Test {
    public static void main(String[] args){
        //创建学生对象
        Student s = new Student();
        s.cardId="43042200205200010";//访问Person类中非私有属性
        s.name="小明";
        s.stuId=1001;
        System.out.println(s.getInfo());//共享了父类的getInfo方法
        s.study();//子类自己方法
        //创建教师对象
        Teacher t = new Teacher();
        t.cardId="430422200205200033";
        t.name="小李";
        t.tro=2001;
        System.out.println(t.getInfo());
        t.teacher();

    }
}
